import http from "@/utils/request";


export default {
    /**
     * 查询菜单列表
     * @param  params 
     * @returns 
     */
    async getMenuList(params) {
        return await http.get("/api/permission/list", params)
    },

    /**
     * 获取上级菜单
     * @param  params 
     * @returns 
     */
    async getParentMenuList(params) {
        return await http.get("/api/permission/parent/list", params)
    },

    /**
     * 添加菜单
     * @param  params 
     * @returns 
     */
    async addMenu(params) {
        return await http.post("/api/permission/add", params)
    },
    /**
     * 修改菜单
     * @param  params 
     * @returns 
     */
    async updateMenu(params) {
        return await http.put("/api/permission/update", params)
    },

    /**
     * 检测菜单下是否存在子菜单
     * @param  params 
     * @returns 
     */
    async check(params) {
        return await http.getRestApi("/api/permission/check", params)
    },

    /**
     * 删除菜单
     * @param  params 
     * @returns 
     */
    async deleteMenu(params) {
        return await http.delete("/api/permission/delete", params)
    }
}